using System;
using System.ComponentModel;
using System.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ApiTest2.Entitys
{
    /// <summary>
    /// 用户消息
    /// </summary>  
    /// <remarks>
    /// <![CDATA[ENGINE=InnoDB  COMMENT='用户消息']]>
    /// </remarks>
    [DbSource("Default"), Serializable]
    public class SysMsg
    {
        /// <summary>
        /// msg_id
        /// </summary>
        /// <remarks>
        /// <![CDATA[bigint NOT NULL COMMENT '']]>
        /// </remarks>
        [Primary]
        public long MsgId { get; set; }

        [JsonConverter(typeof(AutoEnumConverter))]
        public MsgTypeEnum MsgTypeName => (MsgTypeEnum)MsgType;

        /// <summary>
        /// 消息类型 【通知,公告】
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '消息类型 【通知,公告】']]>
        /// </remarks>
        [Column(false)]
        [DisplayName("消息类型")]
        public int MsgType { get; set; }

        /// <summary>
        /// 消息头
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(255) DEFAULT NULL COMMENT '消息头']]>
        /// </remarks>
        [Column(255)]
        [DisplayName("消息头")]
        public string Title { get; set; }

        /// <summary>
        /// 消息内容
        /// </summary>
        /// <remarks>
        /// <![CDATA[text DEFAULT NULL COMMENT '消息内容']]>
        /// </remarks>
        [Column]
        [DisplayName("消息内容")]
        public string Content { get; set; }

        /// <summary>
        /// 连接到
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(64) NOT NULL COMMENT '连接到']]>
        /// </remarks>
        [Column(64, false)]
        [DisplayName("连接到")]
        public string LinkUrl { get; set; }

        /// <summary>
        /// 发布人
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '发布人']]>
        /// </remarks>
        [Column(false)]
        [DisplayName("发布人")]
        public int AdminId { get; set; }

        /// <summary>
        /// 发生时间
        /// </summary>
        /// <remarks>
        /// <![CDATA[datetime NOT NULL COMMENT '发生时间']]>
        /// </remarks>
        [Column(false)]
        [DisplayName("发生时间")]
        public DateTime CreateTime { get; set; }

    }
}
